# daemon alive time, when sets 0s, daemon will not auto exit
aliveTime: 0s

# daemon gc task running interval
gcInterval: 1m0s

# when daemon exit, keep peer task data or not
# it is usefully when upgrade daemon service, all local cache will be saved
keepStorage: true

# all addresses of all schedulers
# the schedulers of all daemons should be same in one region or zone.
# daemon will send tasks to a fixed scheduler by hashing the task url and meta data
# caution: only tcp is supported
scheduler:
  # below example is a stand address
  netAddrs:
  - type: tcp
    addr: scheduler-0.dragonfly-system.svc:8002
  - type: tcp
    addr: scheduler-1.dragonfly-system.svc:8002
  - type: tcp
    addr: scheduler-2.dragonfly-system.svc:8002
  # schedule timeout
  scheduleTimeout: 10s

# when enabled, pprof will be enabled,
verbose: true
console: false

# current host info used for scheduler
host:
  # tcp service listen address
  # port should be set by other options
  listenIP: 0.0.0.0
  # access ip for other peers
  # when local ip is different with access ip, advertiseIP should be set
  advertiseIP: 0.0.0.0
  # geographical location and network topology
  location: ""
  idc: ""

# download service option
download:
  # total download limit per second
  totalRateLimit: 1024Mi
  # per peer task download limit per second
  perPeerRateLimit: 512Mi
  # download grpc option
  downloadGRPC:
    # security option
    security:
      insecure: true
      cacert: ""
      cert: ""
      key: ""
      tlsConfig: null
    # download service listen address
    # current, only support unix domain socket
    unixListen:
      socket: /var/run/dfdaemon.sock
  # peer grpc option
  # peer grpc service send pieces info to other peers
  peerGRPC:
    security:
      insecure: true
      cacert: ""
      cert: ""
      key: ""
    tcpListen:
      # listen address
      listen: 0.0.0.0
      port:
        start: 65010
        end: 65019

# upload service option
upload:
  # upload limit per second
  rateLimit: 1024Mi
  security:
    insecure: true
    cacert: ""
    cert: ""
    key: ""
  tcpListen:
    listen: 0.0.0.0
    port:
      start: 65020
      end: 65029

# peer task storage option
storage:
  # task data expire time
  # when there is no access to a task data, this task will be gc.
  taskExpireTime: 10m0s
  # storage strategy when process task data
  # io.d7y.storage.v2.simple : download file to data directory first, then copy to output path, this is default action
  #                           the download file in date directory will be the peer data for uploading to other peers
  # io.d7y.storage.v2.advance: download file directly to output path, avoid copy to output path
  #                            fast than simple strategy, but:
  #                            the output file will be the peer data for uploading to other peers
  #                            when user delete or change this file, this peer data will be corrupted
  strategy: io.d7y.storage.v2.simple
  multiplex: true

# proxy service option
proxy:
  maxConcurrency: 12
  defaultFilter: Expires&Signature&ns
  security:
    insecure: true
    cacert: ""
    cert: ""
    key: ""
  tcpListen:
    # listen address
    listen: 127.0.0.1
    # listen port, daemon will try to listen
    # when this port is not available, daemon will try next port
    port: 65001
  proxies:
  # proxy all sha256 layer requests with dfget
  - regx: (blobs|manifests|config)/sha256.*
